package PartB;
import java.net.*;


public class EchoServer{
	
	public static void main(String args [])throws Exception{
		
		// open the welcome socket
		ServerSocket welcomeSocket = new ServerSocket(6789);
		
		while (true){
			
			// wait for a connection
			Socket connectionSocket = welcomeSocket.accept();
			
			// create a new Request with the socket
			Request request = new Request(connectionSocket);

			// create a new thread for the runnable request
			Thread thread = new Thread(request);

			// start the thread and loop 
			thread.start();
		}

	}

}
